package com.huajin.codetest.collection;

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class SetTest {
	
	public static void main(String[] args) {
//		List<String> list = Arrays.asList("John", "Harden", "Lee", "Curry", "Stevn");
//		Set<String> hashSet = new HashSet<>(list);
//		Set<String> linkedHashSet = new LinkedHashSet<>(list);
//		System.out.println(list);
//		//-- [John, Harden, Lee, Curry, Stevn] 有序
//		System.out.println(hashSet);
//		//-- [Curry, John, Stevn, Harden, Lee] 无序
//		System.out.println(linkedHashSet);
//		//-- [John, Harden, Lee, Curry, Stevn] 有序
		
		Map<String, Object> map = new LinkedHashMap<>();
		map.put("key", "key");
		//-- 内部类
		map.keySet().size();
	}

}
